package com.javasm.crm.mapper.goodsmapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.javasm.crm.domin.entity.productEntity.ProductVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.List;

@Repository
public interface ProductVoMapper extends BaseMapper<ProductVo> {
    @Select("SELECT p.*,pb.brand_name productbrand,pc.color_name productcolor,pt.type_name producttype,pb.brand_id,pc.color_id,pt.type_id\n" +
            " FROM product_info p INNER JOIN product_brand pb on p.product_brandid=pb.brand_id \n" +
            "INNER JOIN product_color pc on p.product_colorid=pc.color_id INNER JOIN \n" +
            "product_type pt on p.product_typeid=pt.type_id"+" ${ew.customSqlSegment}")
    List<ProductVo> queryall(Page<ProductVo> pagination, @Param(Constants.WRAPPER) QueryWrapper<ProductVo> exampleQueryWrapper);

}